﻿using System;
using System.Threading;
using System.Windows.Forms;

namespace SysTrayRadio
{
    static class Program
    {
        static Mutex s_Mutex;
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {

            bool instantiated;

            s_Mutex = new Mutex(false, "Local\\SysTrayRadio{77C0CF3A-F8BA-4A0E-9E0C-E6B5904494CD}", out instantiated);
            if (!instantiated)
            {
                MessageBox.Show("SysTray Radio is already running \n\rCheck your System Tray", "SysTray Radio", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Main());
        }
    }
}
